<template>
	<view class="my-search-container" :style='{"backgroundColor":bgcolor}' @click="this.$emit('click')">
		<!-- 使用 view 组件模拟 input 输入框的样式 -->
		<view class="my-search-box" :style='{	"borderRadius": radius+"px"}'>
			<uni-icons type="search" size="17" color='#aaa'></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "my-search",
		props: {
			bgcolor: {
				type: String,
				default: 'red'
			},
			radius: {
				type: Number,
				default: 18
			}
		},
		data() {
			return {
			};
		}
	}
</script>

<style lang="scss">
	.my-search-container {
		height: 50px;
		box-sizing: border-box;
		padding: 10px;

		.my-search-box {
			width: 100%;
			background-color: #fff;
			height: 100%;
			text-align: center;
			line-height: 30px;
			color: #aaa;

			text {
				margin-left: 5px;
			}
		}
	}
</style>
